package com.ruoyi.business.mapper;

import java.util.Date;
import java.util.List;
import com.ruoyi.business.domain.EmployeeTraining;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

/**
 * 员工培训记录Mapper接口
 * 
 * @author ruoyi
 * @date 2024-11-18
 */
public interface EmployeeTrainingMapper 
{
    /**
     * 查询员工培训记录
     * 
     * @param id 员工培训记录主键
     * @return 员工培训记录
     */
    public EmployeeTraining selectEmployeeTrainingById(Long id);

    /**
     * 查询员工培训记录列表
     * 
     * @param employeeTraining 员工培训记录
     * @return 员工培训记录集合
     */
    public List<EmployeeTraining> selectEmployeeTrainingList(EmployeeTraining employeeTraining);

    /**
     * 新增员工培训记录
     * 
     * @param employeeTraining 员工培训记录
     * @return 结果
     */
    public int insertEmployeeTraining(EmployeeTraining employeeTraining);

    /**
     * 修改员工培训记录
     * 
     * @param employeeTraining 员工培训记录
     * @return 结果
     */
    public int updateEmployeeTraining(EmployeeTraining employeeTraining);

    /**
     * 删除员工培训记录
     * 
     * @param id 员工培训记录主键
     * @return 结果
     */
    public int deleteEmployeeTrainingById(Long id);

    /**
     * 批量删除员工培训记录
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteEmployeeTrainingByIds(Long[] ids);

    @Delete("DELETE FROM t_employee_Training")
    void clearTable();

     String selectByTrainingForm(@Param("employeeId") String employeeId, @Param("trainingForm") String trainingForm, @Param("awardYear") Date awd);

    @Delete("DELETE FROM t_employee_Training WHERE DATE_FORMAT(award_year, '%Y') = DATE_FORMAT(#{awd}, '%Y')")
    void clearTableYear(Date awd);
}
